﻿using GN.Pay.Client.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.Client.Impl
{
    /// <summary>
    /// 默认支付配置
    /// </summary>
    public class PayConfigure : IPayConfigure
    {
        /// <summary>
        /// 实例化 DefaultPayConfigure 新实例
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="appKey"></param>
        /// <param name="merchantId"></param>
        /// <param name="serverUrl"></param>
        public PayConfigure(string appId,
            string appKey,
            string merchantId,
            string serverUrl)
        {
            this.AppId = ExceptionUtils.CheckNotNullOrNotWhiteSpace(appId, nameof(appId));
            this.AppKey = ExceptionUtils.CheckNotNullOrNotWhiteSpace(appKey, nameof(appKey));
            this.MerchantId = ExceptionUtils.CheckNotNullOrNotWhiteSpace(merchantId, nameof(merchantId));
            this.ServerUrl = ExceptionUtils.CheckNotNullOrNotWhiteSpace(serverUrl, nameof(serverUrl));
        }

        /// <summary>
        /// 获取应用id
        /// </summary>
        public string AppId { get; private set; }

        /// <summary>
        /// 获取应用Key
        /// </summary>
        public string AppKey { get; private set; }

        /// <summary>
        /// 获取商户
        /// </summary>
        public string MerchantId { get; private set; }

        /// <summary>
        /// 服务器Url
        /// </summary>
        public string ServerUrl { get; private set; }
    }
}
